<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>Menu Management</title>
</head>
<link rel="stylesheet" href="../../../resources/css/fw-edit.css"
	type="text/css">
<script src="../../../script/base.js"></script>
<body>
<f:view>
	<f:loadBundle basename="net.orange.conf.lang.fw" var="msg" />
	<h:form id="myForm">
		<h:inputHidden value="#{menu.content.pk}" id="pk" />
		<h:inputHidden value="#{menu.editMode}" id="editMode" />

		<h:panelGrid columns="2" rowClasses="content-title"
			style="width:100%;">
			<h:outputText value="#{msg.menu_title}." />

			<h:panelGroup style="text-align:right">
				<h:commandButton value="#{msg.common_edit}" type="submit"
					id="cmdEdit" action="#{menu.edit}" styleClass="button-normal"
					rendered="#{not menu.editMode}" />

				<h:commandButton value="#{msg.common_save}" type="submit"
					id="cmdSave" action="#{menu.save}" styleClass="button-normal"
					rendered="#{menu.editMode}" />

				<h:outputText value="    " />
				<h:commandButton value="#{msg.common_cancel}" type="submit"
					id="cmdCancel" action="#{menu.back}" styleClass="button-normal" />
			</h:panelGroup>
		</h:panelGrid>

		<hr>

		<h:messages styleClass="content-message" />

		<h:panelGrid columns="2" styleClass="content-table"
			columnClasses="content-detail-title,content-detail">

			<h:outputLabel value="#{msg.common_pk}:" />
			<h:outputText value="#{menu.content.pk}" />

			<h:outputLabel value="#{msg.menu_code}:" />
			<h:inputText value="#{menu.content.menu_code}" id="menu_code"
				disabled="#{not menu.editMode}" style="width:240px" />

			<h:outputLabel value="#{msg.menu_name}:" />
			<h:inputText value="#{menu.content.menu_name}" id="menu_name"
				disabled="#{not menu.editMode}" style="width:240px" />

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />

			<h:outputLabel value="#{msg.menu_label}:" />
			<h:inputText value="#{menu.content.label}" id="label"
				disabled="#{not menu.editMode}" style="width:240px" />

			<h:outputLabel value="#{msg.menu_labelIndex}:" />
			<h:inputText value="#{menu.content.labelIndex}" id="labelIndex"
				disabled="#{not menu.editMode}" style="width:240px" />

			<h:outputLabel value="#{msg.menu_url}:" />
			<h:inputText value="#{menu.content.url}" id="url"
				disabled="#{not menu.editMode}" style="width:240px" />

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />

			<h:outputLabel value="#{msg.menu_superior}:" />
			<h:selectOneMenu value="#{menu.parent_menu_code}"
				id="parent_dept_code" disabled="#{not menu.editMode}"
				style="width:240px">
				<f:selectItem itemLabel="" itemValue="" />
				<f:selectItems value="#{menu.menus}" />
			</h:selectOneMenu>

			<h:outputLabel value="#{msg.menu_level}:" />
			<h:selectOneMenu value="#{menu.content.level}" id="level"
				disabled="#{not menu.editMode}" style="width:240px">
				<f:selectItems value="#{menu.levels}" />
			</h:selectOneMenu>

			<h:outputLabel value="#{msg.menu_seq}:" />
			<h:inputText value="#{menu.content.seq}" id="seq"
				disabled="#{not menu.editMode}" style="width:240px" />


			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />

			<h:outputLabel value="#{msg.menu_group}:" />
			<h:selectManyListbox id="grouppks" value="#{menu.grouppks}"
				disabled="#{not menu.editMode}" size="4" style="width:240px">
				<f:selectItems value="#{group.groups}" />
			</h:selectManyListbox>

			<h:outputLabel value="&nbsp;" />
			<h:outputLabel value="&nbsp;" />

			<h:outputLabel value="#{msg.common_description}:" />
			<h:inputTextarea value="#{menu.content.description}" id="description"
				style="width:240px" disabled="#{not menu.editMode}" rows="4" />

		</h:panelGrid>
	</h:form>
</f:view>
</body>
</html>
